package sctu.edu.java.year2016.team03.huangbaolian.day20160521.chapter4_3;

/**
 * Created by hbl on 2016/5/23.
 */
public class ni {
    public static void main(String[] args) {
        int a = 1;
        float sum = 0.0f;
        while (a < 9) {
            sum += 1 / (float) jiecheng(a);
            a++;

        }
        System.out.println(sum);
    }

    public static int jiecheng(int a) {
        int i = 1;
        int rank = 1;
        while (i <= a) {
            rank *= i;
            i++;
        }
        return rank;
    }
}
